package controller

import (
	"context"
	"github.com/gogf/gf/v2/errors/gcode"
	"github.com/gogf/gf/v2/errors/gerror"
	"github.com/gogf/gf/v2/frame/g"
	"goframe/apiv1"
)

var (
	Login = cLogin{}
)

type cLogin struct {

}

func (c *cLogin) Login(ctx context.Context,req *apiv1.LoginReq) (res *apiv1.LoginRes,err error) {

	_,err = g.Redis().Do(ctx,"LPUSH","list",req.Name)
	if err != nil {
		err = gerror.NewCode(gcode.CodeDbOperationError,err.Error())
	}
	g.RequestFromCtx(ctx).Response.RawWriter()
	return
}